package com.cskaoyan.service;

import com.cskaoyan.exception.CustomException;
import org.springframework.stereotype.Service;

/**
 * @author stone
 * @date 2022/08/10 10:08
 */
@Service
public class UserServiceImpl implements UserService{
    @Override
    public int createUser(Integer age) throws CustomException {
        if (age < 18) {
            //停止应用，并且响应对应Json
            //return -1;
            throw new CustomException("未满18周岁");
        }

        return 0;
    }
}
